<template>
	<view class="content" >
		<view v-if="show_main" class="main" >
			<view v-for="(item,index) in list" :key="index" @click="goPage" :data-uri="'/pages/business-create2/business-create2?classify_id='+item.id" class="disf bgf p30 mt20">
			
				<view style="width: 86rpx;height: 86rpx;overflow: hidden;border-radius:4px;flex-shrink: 0;">
					<u-image width="88rpx" height="88rpx" :src="item.icon_pic">
						<template v-slot:error>
							<image src="/static/image/default-user.png" style="width:88rpx;height: 88rpx;"></image>
						</template>
					</u-image>
				</view>
				<view class="ml10 pr f32" style="top:1rpx;width: 100%;">
					<view class="disfr-lr"><view>{{item.name}}</view><view><u-icon name="arrow-right" color="#999"></u-icon></view></view>
					<view class="f28 col999 mt5">{{item.bewrite}}</view>
				</view>
				
			</view>	
			<view style="height: 20rpx;"></view>
		</view>		
	    <loading :loading="not_load"/><!--加载状态-->
	</view>
</template>

<script setup>
import { onLoad, onShow, onHide, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app';
import { ref } from 'vue';	
const show_main=ref(false);
const not_load=ref(false);
const list=ref([]);

//页面加载时
onLoad(async (options)=>{
    loadPage(options,false);
});
//页面显示时执行
onShow(()=>{
	//console.log('语法糖onShow');
});
//页面隐藏时执行
onHide(()=>{
	//console.log('语法糖onHide');
});
/**
 * 加载接口数据
 * @param {Object} options  参数,对像数组
 * @param {Object} isPage   是否加载大于1页
 */
const loadPage=async (options,isPage)=>{
	let ret = await uni.$get('/appapi-opportunity-gettypes',options);
	if(ret.error_code != 0){
		uni.$utils.showToast(ret.info);
		return;
	}
	show_main.value=true;
	not_load.value=true;
	list.value=ret.data;
};
/**
 * 模板属性跳转页面
 * @param {Object} e
 */
function goPage(event){
	uni.$utils.dataSetPage(event);
};

</script>

<style  lang="scss">
	page {
		
	}
.fnow{color:#2979ff;}
</style>
